//
//  MonitoringView.m
//  PigMarket
//
//  Created by mac on 2019/7/5.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import "MonitoringView.h"

@interface MonitoringView ()
/**
 底部view
 */
@property (nonatomic , strong) UIView *bottomBgView;

@end
@implementation MonitoringView

#pragma mark - init method
- (instancetype)init
{
    self = [super init];
    if (self) {
        [self initView];
        [self initLayout];
    }
    return self;
}

- (void)initView {
    // 添加子控件
//    [self addSubview:self.bottomBgView];
    [self addSubview:self.playBtn];
    [self addSubview:self.changeCameraBtn];
    [self addSubview:self.changeSharpnessBtn];
    [self addSubview:self.fullScreenBtn];
}

- (void)initLayout {
    // 布局子控件
//    [self.bottomBgView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.right.bottom.mas_equalTo(0);
//        make.height.mas_equalTo(ScaleHeight(40));
//    }];
    [self.playBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.mas_centerY);
        make.centerX.mas_equalTo(self.mas_centerX).multipliedBy(0.25);
        make.size.mas_equalTo(ScaleHeight(22));
    }];
    [self.changeCameraBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.mas_centerY);
        make.centerX.mas_equalTo(self.mas_centerX).multipliedBy(0.75);
        make.size.mas_equalTo(ScaleHeight(22));
    }];
    [self.changeSharpnessBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.mas_centerY);
        make.centerX.mas_equalTo(self.mas_centerX).multipliedBy(1.25);
        make.size.mas_equalTo(CGSizeMake(ScaleWidth(40), ScaleHeight(20)));
    }];
    [self.fullScreenBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.mas_centerY);
        make.centerX.mas_equalTo(self.mas_centerX).multipliedBy(1.75);
        make.size.mas_equalTo(ScaleHeight(22));
    }];
}

#pragma mark - getter and setter
- (UIView *)bottomBgView {
    if (!_bottomBgView) {
        _bottomBgView = [[UIView alloc] init];
        _bottomBgView.backgroundColor = [UIColor colorWithHexString:@"#000000" alpha:0.6];
    }
    return _bottomBgView;
}
- (UIButton *)playBtn {
    if (!_playBtn) {
        _playBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_playBtn setBackgroundImage:[UIImage imageNamed:@"adopted_look_play"] forState:UIControlStateNormal];
        [_playBtn setBackgroundImage:[UIImage imageNamed:@"adopted_look_stop"] forState:UIControlStateSelected];
    }
    return _playBtn;
}
- (UIButton *)changeCameraBtn {
    if (!_changeCameraBtn) {
        _changeCameraBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_changeCameraBtn setBackgroundImage:[UIImage imageNamed:@"adopted_look_changecamera"] forState:UIControlStateNormal];
    }
    return _changeCameraBtn;
}
- (UIButton *)changeSharpnessBtn {
    if (!_changeSharpnessBtn) {
        _changeSharpnessBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_changeSharpnessBtn setTitle:@"标准" forState:UIControlStateNormal];
        [_changeSharpnessBtn setTitleColor:[UIColor colorWithHexString:@"#E4E6E8"] forState:UIControlStateNormal];
        _changeSharpnessBtn.titleLabel.font = [UIFont systemFontOfSize:11];
        _changeSharpnessBtn.layer.borderColor = [UIColor colorWithHexString:@"#E4E6E8"].CGColor;
        _changeSharpnessBtn.layer.borderWidth = 1;
        _changeSharpnessBtn.layer.cornerRadius = 3;
        _changeSharpnessBtn.layer.masksToBounds = YES;
    }
    return _changeSharpnessBtn;
}
- (UIButton *)fullScreenBtn {
    if (!_fullScreenBtn) {
        _fullScreenBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_fullScreenBtn setBackgroundImage:[UIImage imageNamed:@"adopted_look_fullscreen"] forState:UIControlStateNormal];
    }
    return _fullScreenBtn;
}

@end
